//
//  YLIconTitleNumberCell.m
//  YLFinanceService
//
//  Created by she1323 on 2017/9/1.
//  Copyright © 2017年 she1323. All rights reserved.
//

#import "YLIconTitleNumberCell.h"
#import "YLIconTitleModel.h"
@interface YLIconTitleNumberCell ()
@property (weak, nonatomic) IBOutlet UIImageView *icon;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UIView *spot;
@property (weak, nonatomic) IBOutlet UILabel *number;

@end

@implementation YLIconTitleNumberCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    _spot.layer.masksToBounds = YES;
    _spot.layer.cornerRadius = 2.0;
    // Initialization code
}

+ (NSString *)cellID
{
    return @"YLIconTitleNumberCell";
}

- (void)setNumberModel:(YLIconTitleNumberModel *)numberModel
{
    _numberModel = numberModel;
    _icon.image = [UIImage imageNamed:numberModel.icon];
    _titleLabel.text = numberModel.title;
    
    if (numberModel.number == 0) {
        _spot.hidden = YES;
        
        _number.hidden = YES;
        
    } else {
        _number.text = [NSString stringWithFormat:@"%zd", numberModel.number];
        _number.hidden = NO;
        _spot.hidden = NO;
    }
    
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
